home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ETO Development Tools 1
/
ETO Development Tools 1.iso
/
Tools - Objects
/
Installation Folder
/
Install
< prev
next >
Wrap
Text File
|
1990-07-23
|
9KB
|
378 lines
# C D I N S T A L L A T I O N S C R I P T
#
# Copyright Apple Computer, Inc. 1987, 1988, 1989, 1990
# All rights reserved.
#
# This script is used to install MPW, MacApp, C++, SADE, MacsBug,
# ResEdit and MPW 411 from the E.T.O. #1 distribution compact disk
# onto a destination hard disk. This can also update from previous
# versions of these products to the latest releases and revert from
# later versions to a previous release.
#
# This script accepts the following options (set by the Commando interface):
#
# -to sets the "to" directory
# -from sets the "from" directory(s)
# -custom sets the custom files list
#
# -install flag to install a new complete version of MPW
# -update flag to update an existing version of MPW (default behaviour)
# -revert flag to revert to a previous version of MPW
#
# -progress flag to show progress
#
# -SADE1.0 flag to install SADE environment (version 1.0)
# -SADE1.1 flag to install SADE environment (version 1.1)
# -SADE1.2 flag to install SADE environment (version 1.2a1)
#
# -MB6.1 flag to install Macsbug (version 6.1 - in System Folder)
# -MB6.2 flag to install Macsbug (version 6.2a4 - in System Folder)
#
# -MPW3.0 flag to install MPW (version 3.0)
# -MPW3.1 flag to install MPW (version 3.1)
# -MPW3.2 flag to install MPW (version 3.2 EXP)
#
# -MacApp flag to install MacApp (version 2.0)
# -C++1 flag to install C++ (version 3.1b1)
# -C++4 flag to install C++ (version 3.1b4)
#
# -411Tools flag to install 411 in MPW folder (Tools only)
# -411All flag to install 411 in MPW folder (Complete environment)
#
##################
### DEBUG CODE ###
##################
Set DebugFlag 0 # Set to 1 for debugging, set to 0 for normal operation
##################
Set quit 0 # Clear our user-defined quit flag. If it
# is ever Set non-zero, the user hit cancel
# somewhere and the script quits immediately.
Set Exit 0
### Set some defaults
Set CDVolume "E.T.O. #1:" ### the volume name of the distribution CD
Export CDVolume
# {DestVolume} - the volume name of the destination hard drive
### Get the current volume name
Set DestVolume `which "{0}"` # get pathname of this script
Set DestVolume "`files -q -f "{DestVolume}"`" # convert to full pathname
If "{DestVolume}"=~/(≈:)®1≈/ # strip the filename
Set DestVolume "{®1}"
End
Loop
If "{DestVolume}"=~/(≈:)®1≈:/ # strip all sub-directories
Set DestVolume "{®1}"
Else
Break
End
End
export DestVolume
### Export some variables used by the Installer
set ToDir "'{DestVolume}MPW Folder:'" # Destination ("to") directory
set ChkDir "{DestVolume}MPW Folder:" # Destination ("to") directory
set FromDirs "" # Source ("from") directory list
set InstallFlag 1 # Controls Update/Install/Revert (Update is the default)
set UpdateFlag "Update"
set RevertFlag "" # Controls revert function
set ProgressOption "" # Controls progress display
set MacAppFlag 0 # set for MacApp Installation (to install 411 files)
export MacAppFlag
set SADEOption 0 # Controls SADE Installation
export SADEOption
set MacsbugOption 0 # Controls Macsbug Installation
export MacsbugOption
set 411Option 0 # Controls 411 Installation
export 411Option
set ResEditOption 0 # Controls ResEdit Installation
export ResEditOption
### Source Directories
set MPWSource "{CDVolume}Tools - Objects:Macintosh Programmer’s Workshop:"
export MPWSource
set MacAppSource "{CDVolume}Tools - Objects:MacApp:MacApp 2.0 CD Release:"
export MacAppSource
set CPlusSource "{CDVolume}Tools - Objects:C∂+∂+:"
export CPlusSource
### Let's get started...
If "{#}" == "0" ### Command Line is Empty
Exit 1
End
### See if the source volume exists...
If Not "`Exists -d "{CDVolume}"`"
Alert "Volume {CDVolume} is not online!"
Exit 1
End
### Collect the script parameters.
Loop
Break if {#} == 0
If "{1}" =~ /-from/
Set FromDirs "{FromDirs}'{2}' "
shift 2
continue
Else If "{1}" =~ /-to/
Set toDir "'{2}'"
shift 2
continue
Else If "{1}" =~ /-custom/
Set FromDirs "{FromDirs}'{2}' "
shift 2
continue
Else If "{1}" =~ /-update/
set InstallFlag 1
set UpdateFlag "Update"
set RevertFlag ""
shift 1
continue
Else If "{1}" =~ /-install/
set InstallFlag 2
set UpdateFlag "Install"
set RevertFlag ""
shift 1
continue
Else If "{1}" =~ /-revert/
set InstallFlag 3
set UpdateFlag "Revert"
set RevertFlag "-revert"
shift 1
continue
Else If "{1}" =~ /-MPW3.0/
Set FromDirs "{FromDirs}'{MPWSource}MPW 3.0:MPW:' "
If Not "`Exists -d {ToDir}`"
NewFolder {ToDir}
End
shift 1
continue
Else If "{1}" =~ /-MPW3.1/
Set FromDirs "{FromDirs}'{MPWSource}MPW 3.1:MPW:' "
If Not "`Exists -d {ToDir}`"
NewFolder {ToDir}
End
shift 1
continue
Else If "{1}" =~ /-MPW3.2/
Set FromDirs "{FromDirs}'{MPWSource}MPW 3.2 EXP1:MPW:' "
If Not "`Exists -d {ToDir}`"
NewFolder {ToDir}
End
shift 1
continue
Else If "{1}" =~ /-MacApp/
If "`Exists -d "{MacAppSource}MacApp 2.0 (Hard Disk Ready):"`"
Set FromDirs "{FromDirs}'{MacAppSource}MacApp 2.0 (Hard Disk Ready):' "
Set MacAppFlag 1
End
shift 1
continue
Else If "{1}" =~ /-CPlus1/
If "`Exists -d "{CPlusSource}MPW C++ 3.1B1:"`"
Set FromDirs "{FromDirs}'{CPlusSource}MPW C∂+∂+ 3.1B1:' "
End
shift 1
continue
Else If "{1}" =~ /-CPlus4/
If "`Exists -d "{CPlusSource}MPW C++ 3.1B4:"`"
Set FromDirs "{FromDirs}'{CPlusSource}MPW C∂+∂+ 3.1B4:' "
End
shift 1
continue
Else If "{1}" =~ /-SADE1.0/
set SADEOption 1
shift 1
continue
Else If "{1}" =~ /-SADE1.1/
set SADEOption 2
shift 1
continue
Else If "{1}" =~ /-SADE1.2/
set SADEOption 3
shift 1
continue
Else If "{1}" =~ /-MB6.1/
set MacsbugOption 1
shift 1
continue
Else If "{1}" =~ /-MB6.2/
set MacsbugOption 2
shift 1
continue
Else If "{1}" =~ /-411Tools/
set 411Option 1
shift 1
continue
Else If "{1}" =~ /-411All/
set 411Option 2
shift 1
continue
Else If "{1}" =~ /-ResEdit1.2/
set ResEditOption 1
shift 1
continue
Else If "{1}" =~ /-ResEdit2.0/
set ResEditOption 2
shift 1
continue
Else If "{1}" =~ /-progress/
set ProgressOption "-p"
shift 1
continue
Else If "{1}" =~ /-≈/
Echo "### {0} - ∂"{1}∂" is not an option." > Dev:StdErr
Echo "# Usage - {0} -to dirname [ -from DirName | -custom filename ]" > Dev:StdErr
Echo "# [ -install | -update | -revert ] [ -progress ]" > Dev:StdErr
Echo "# [ -SADE ] [ -Macsbug ]" > Dev:StdErr
Exit 1
End
End
If "{ToDir}" == ""
Echo "### {0} - Must Select Destination Directory"
Exit 1
Else If "{FromDirs}" == "" && "{SADEOption}" == "0" &&
"{MacsBugOption}" == "0" && "{411Option}" == "0" && "{ResEditOption}" == "0"
Echo "### {0} - Must Select Source Directory"
Exit 1
End
If Not "`Exists -d "{CDVolume}"`"
Alert "Volume {CDVolume} is not online!"
Exit 1
End
If {DebugFlag} == 1
echo "FromDirs: {FromDirs}" > Dev:StdOut
echo "ToDir: {ToDir}" > Dev:StdOut
echo "CustomFiles: {CustomFiles}" > Dev:StdOut
echo "UpdateFlag: {UpdateFlag}" > Dev:StdOut
echo "InstallFlag: {InstallFlag}" > Dev:StdOut
echo "RevertFlag: {RevertFlag}" > Dev:StdOut
echo "RevertOption: {RevertOption}" > Dev:StdOut
echo "ProgressOption:{ProgressOption}" > Dev:StdOut
Exit 1
End
# The backup tool will generate shell commands to copy the files off
# of the distribution compact disk into the final destination folder.
If "{FromDirs}" != ""
For dir in {FromDirs}
"{ShellDirectory}"Backup -from "{dir}" -to {ToDir} -r -a -c {RevertFlag} {ProgressOption} > copyStuff
# The DoIt script will execute the copy commands in the temporary
# copyStuff file. It will highlight each command as it is executed.
"{ShellDirectory}"DoIt copyStuff ≥ errorFile
End
End
### Now handle the special cases like SADE, Macsbug, 411 and ResEdit
### One More Time...
If Not "`Exists -d "{CDVolume}"`"
Alert "Volume {CDVolume} is not online!"
Exit 1
End
### Special for MacApp - move the UserStartup file up one level and rename the folder
If "{MacAppFlag}" != "0"
If "`Exists -f "{ChkDir}MacApp:UserStartup•MacApp"`"
catenate "{ChkDir}MacApp:UserStartup•MacApp" >> "{ChkDir}UserStartup•MacApp"
End
# Automate the "Where is the MacApp folder?" dialogue
echo "{ChkDir}MacApp:" >> "{ChkDir}MacApp_Folder"
End
### Install SADE 1.0, 1.1 or 1.2a1
If "{SADEOption}" != "0"
If "{ProgressOption}" =~ /-p/
Echo "Now Copying SADE..."
End
"SADE Install" ≥ errorFile
End
### Install Macsbug v. 6.1 or 6.2a4
If "{MacsbugOption}" != "0"
If "{ProgressOption}" =~ /-p/
Echo "Now Copying MacsBug..."
End
"MacsBug Install" ≥ errorFile
End
### Install ResEdit
If "{ResEditOption}" != "0"
If "{ProgressOption}" =~ /-p/
Echo "Now Copying ResEdit..."
End
"ResEdit Install" ≥ errorFile
End
### Install 411
If "{411Option}" != "0"
If "{ProgressOption}" =~ /-p/
Echo "Now Copying 411..."
End
"411 Install" ≥ errorFile
End
# If we got some error while copying the file from the distribution
# compact disk to the destination disk, display the error message and quit.
If "`Exists -f "errorFile"`"
Open -t errorFile
Find • errorFile
Find /'#'/ errorFile ### There is an error
Set FindStatus {Status}
Close errorFile
Else
Set FindStatus 1
End
If {FindStatus} == 0
Alert "`catenate errorFile`"
Close -n copyStuff ≥ dev:null
Quit
Else
Delete copyStuff ≥ dev:null
End
Exit 0